﻿<%@ Page Language="C#" MasterPageFile="~/Main/AdminPage.master" AutoEventWireup="true" CodeFile="NewsList.aspx.cs" Inherits="Main_NewsList" Title="新闻列表" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table>
        <tr>
            <td>
               主题：</td>
            <td>
                <asp:DropDownList ID="ddltopic" runat="server" 
                onselectedindexchanged="ddltopic_SelectedIndexChanged" 
                AppendDataBoundItems="True" AutoPostBack="True">
                <asp:ListItem Value="0">--请选择--</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
               板块：</td>
            <td>
                <asp:DropDownList ID="ddlmodule" runat="server" 
                onselectedindexchanged="ddlmodule_SelectedIndexChanged" 
                AppendDataBoundItems="True">
                <asp:ListItem Value="0">--请选择--</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
                新闻标题：</td>
            <td>
                 <asp:TextBox ID="txttitle" runat="server"></asp:TextBox></td>
            <td>
                  <asp:Button ID="btnsearch" runat="server" Text="查找" onclick="btnsearch_Click" /></td>
        </tr>
    </table>
    <div style="width:680px">
        <asp:GridView ID="gvnews" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
            BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="Nid" 
            OnPageIndexChanging="gvnews_PageIndexChanging" OnRowCommand="gvnews_RowCommand" 
            PageSize="20" Width="680px" onrowdatabound="gvnews_RowDataBound">
            <Columns>
                <asp:TemplateField HeaderText="新闻标题">
                    <ItemTemplate>
                        <asp:HyperLink ID="hltitle" runat="server" Target="_blank" 
                            Text='<%# Eval("Nmaintitle") %>' ToolTip='<%# Eval("Nmaintitle") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="头条">
                    <ItemTemplate>
                        <asp:Label ID="labtop" runat="server" Text='<%# Eval("Ntop") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Tname" HeaderText="主题" />
                <asp:BoundField DataField="Mname" HeaderText="模块" />
                <asp:TemplateField HeaderText="时间">
                    <ItemTemplate>
                        <asp:Label ID="labtime" runat="server" Text='<%# Eval("Ntime") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Nauthor" HeaderText="作者"/>
                <asp:BoundField DataField="Nposter" HeaderText="发布者"/>
                <asp:TemplateField HeaderText="修改">
                    <ItemTemplate>
                        <asp:HyperLink ID="hlupdate" runat="server">修改</asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="删除">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbdelete" runat="server" 
                            CommandArgument='<%# Eval("Nid") %>' CommandName="del">删除</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle CssClass="FooterStyle" HorizontalAlign="Center" VerticalAlign="Middle" />
            <PagerStyle CssClass="PagerStyle" HorizontalAlign="Center" VerticalAlign="Middle" />
            <SelectedRowStyle CssClass="SelectedRowStyle" HorizontalAlign="Center" VerticalAlign="Middle" />
            <HeaderStyle CssClass="HeaderStyle" HorizontalAlign="Center" VerticalAlign="Middle" />
            <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <AlternatingRowStyle CssClass="AlternatingRowStyle" HorizontalAlign="Center" VerticalAlign="Middle" />
        </asp:GridView>
    </div>
</asp:Content>

